package com.example.demo.dto;

import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.example.demo.entity.OrderSku;
import com.example.demo.entity.Orders;
import com.example.demo.entity.Sku;
import com.diboot.iam.entity.IamUser;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import com.example.demo.entity.Customer;

import java.util.List;

/**
 * 订单sku DTO定义
 * @author MyName
 * @version 1.0
 * @date 2024-01-17
 * Copyright © MyCompany
 */
@Getter
@Setter
@Accessors(chain = true)
public class OrderSkuDTO extends OrderSku {

    private static final long serialVersionUID = -8424960992774954346L;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindQuery(comparison = Comparison.EQ, entity = IamUser.class, field = "realname", condition = "this.create_by=id")
    private String createByName;

    /**
     * 关联字段 系统用户.真实姓名：IamUser.realname
     */
    @BindQuery(comparison = Comparison.EQ, entity = IamUser.class, field = "realname", condition = "this.update_by=id")
    private String updateByName;

    /**
     * 关联字段 客户.名称：Customer.name
     */
    @BindQuery(comparison = Comparison.EQ, entity = Customer.class, field = "name", condition = "this.customer_id=id")
    private String customerName;

    @BindQuery(comparison = Comparison.BETWEEN, field = "createTime")
    private List<String> createTimeList;
}
